<template>
    <div>
        <el-card :body-style="{ padding: '0px' }">
            <div class="userlistTitle">基础信息</div>
            <el-table
                border
                :show-header="false"
                :data="messageBasics"
                style="margin:10px;width:801px">
                <el-table-column
                    prop="one"
                    width="200">
                </el-table-column>
                <el-table-column
                    prop="two"
                    width="200">
                </el-table-column>
                <el-table-column
                    prop="Three"
                    width="200">
                </el-table-column>
                <el-table-column
                    prop="Four"
                    width="200">
                </el-table-column>
            </el-table>
            <div class="userlistTitle">详细信息</div>
            <el-table
                border
                :show-header="false"
                :data="messageDetailed"
                style="margin:10px;width:801px">
                <el-table-column
                    prop="one"
                    width="200">
                </el-table-column>
                <el-table-column
                    prop="two"
                    width="200">
                    <template slot-scope="scope">
                        <img v-if="scope.$index == 0" class="toyxiang" :src="scope.row.two" referrerPolicy="no-referrer">
                        <span v-else>{{scope.row.two}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="Three"
                    width="200">
                </el-table-column>
                <el-table-column
                    prop="Four"
                    width="200">
                </el-table-column>
            </el-table>
            <el-button type="success" class="fanhuiBtn" @click="toUserlist">返回</el-button>
        </el-card>
    </div>
</template>

<script>
export default {
    data() {
        return {
            messageBasics: [],
            messageDetailed: []
        }
    },
    methods:{
        toUserlist(){
            this.$router.push('/Usermanage/Userlist')
        }
    },
    created(){
        var userId = this.$route.query.userId
        this.$http.post('getUserdetails',{userId}).then((data)=>{
            if(data.data.success){
                var num = data.data.msg.length;
                if ( num>1 ) this.$message({
                	showClose: true,
                	message: data.data.msg,
                	type: 'success',
                	offset:'65',
                	duration:1000
                });
                this.messageBasics = data.data.data.messageBasics;
                this.messageDetailed = data.data.data.messageDetailed;
            }else{
                this.$message.error(data.data.msg)
            }
        })
    }
}
</script>

<style scoped>
.el-card{
    margin: 8px;
}
.userlistTitle{
    font-size: 14px;
    border-left: 4px solid #2ad199;
    margin: 16px 16px 0;
    text-indent: 10px;
}
.toyxiang{
    width: 30px;
    height: 30px;
    border-radius: 50%;
}
.fanhuiBtn{
    background-color: #2AD198;
    color: #fff;
    width: 117px;
    margin: 0 10px 10px;
}
</style>